home *** CD-ROM | disk | FTP | other *** search
- /*------------------------------------------------------------------------------
-
- File : AudioPort.h
-
- Author : Stéphane TAVENARD
-
- $VER: AudioPort.h 1.3 (22/07/1995)
-
- (C) Copyright 1995-1995 Stéphane TAVENARD
- All Rights Reserved
-
- #Rev| Date | Comment
- ----|----------|--------------------------------------------------------
- 0 |14/05/1995| Initial revision ST
- 1 |25/05/1995| 8-bit or 16-bit mode ST
- 2 |19/06/1995| Added FreeSignal in DeletePort ST
- 3 |23/06/1995| Aminet release ST
- 4 |09/07/1995| Use now ex_EClockFrequency for period calculation ST
- 5 |22/07/1995| Added volume control for 16-bit samples ST
-
- ------------------------------------------------------------------------
-
- Definition of audio port
-
- ------------------------------------------------------------------------------*/
-
- #ifndef AUDIOPORT_H
- #define AUDIOPORT_H
-
- #include <exec/types.h>
- #include <exec/io.h>
-
- /* Control flags at Open only */
- #define AUF_STEREO (1<<0) /* Stereo samples */
- #define AUF_16BITS (1<<1) /* 16-bit samples, 8-bit otherwise */
- #define AUF_MIXING (1<<6) /* Mixing used #5 */
- /* Control flags (others) */
- #define AUF_FILTER (1<<2) /* Set Filter */
- #define AUF_VOL (1<<3) /* Set Volume */
- #define AUF_FREQ (1<<4) /* Set Frequency */
- #define AUF_NOWAIT (1<<5) /* Do not wait end of write */
- /* Audio commands */
- #define AUC_CONTROL 0
- #define AUC_WRITE 1
- #define AUC_STOP 2
- #define AUC_CONTINUE 3
-
- typedef struct {
- void *hard_port; /* Audio port private */
- UBYTE flags; /* Control flags = combination of AUC_M_xxx */
- UBYTE signal; /* signal if you want to wait IO yourself after a write */
- UBYTE command; /* Audio command */
- UBYTE filter_on; /* 0=filter off 1=filter on */
- ULONG frequency;
- UWORD l_vol, r_vol; /* 0..64 only for 8-bit mode */
- WORD *l_wave; /* Buffer of 8-bit or 16-bit L wave */
- WORD *r_wave; /* Buffer of 8-bit or 16-bit R wave */
- ULONG wave_length; /* Length of wave to output MUST BE EVEN !!! */
- ULONG mixing_frequency; /* Mixing frequency if AUF_MIXING set */
- LONG error;
- } AU_PORT;
-
-
- #ifndef ASM
- #ifdef __SASC
- #define ASM_A0 register __a0
- #define ASM_A1 register __a1
- #define ASM_A2 register __a2
- #define ASM_A3 register __a3
- #define ASM_A4 register __a4
- #define ASM_A5 register __a5
- #define ASM_A6 register __a6
- #define ASM_D0 register __d0
- #define ASM_D1 register __d1
- #define ASM_D2 register __d2
- #define ASM_D3 register __d3
- #define ASM_D4 register __d4
- #define ASM_D5 register __d5
- #define ASM_D6 register __d6
- #define ASM_D7 register __d7
- #define ASM __asm
- #else
- #define ASM_A0 __A0
- #define ASM_A1 __A1
- #define ASM_A2 __A2
- #define ASM_A3 __A3
- #define ASM_A4 __A4
- #define ASM_A5 __A5
- #define ASM_A6 __A6
- #define ASM_D0 __D0
- #define ASM_D1 __D1
- #define ASM_D2 __D2
- #define ASM_D3 __D3
- #define ASM_D4 __D4
- #define ASM_D5 __D5
- #define ASM_D6 __D6
- #define ASM_D7 __D7
- #define ASM
- #endif
- #endif
-
- AU_PORT ASM *AU_open( ASM_D0 UBYTE flags, ASM_D1 int buffer_size );
- /*---------------------------------------------
- Open an audio port.
- buffer_size is the size of the audio buffers
- buffer_size must be even and < 0x20000
- */
-
- void ASM AU_close( ASM_A0 AU_PORT *audio_port );
- /*----------------------------------
- Close an audio port.
- */
-
- void ASM AU_write( ASM_A0 AU_PORT *audio_port );
- /*----------------------------------
- Write into an audio port
- */
-
-
- #endif /* AUDIOPORT_H */
-